{% extends 'PHPDishWebBundle:Common:notification_layout.html.twig' %}

{% block title %} {{ 'notification.my_notification'|trans }}{% endblock %}

{% block notification_content %}
    <div class="panel panel-u">
        <div class="panel-heading">{{ 'notification.my_notification'|trans }}</div>
        <ul class="list-group notification-list">
            {% import 'PHPDishWebBundle:Macros:notifications.html.twig' as renderer %}
            {% for meta in notificationMeta %}
                <li class="list-group-item">
                    <div class="media notification">
                        <div class="media-body">
                            <div class="heading">
                                {{ meta.notification.subject|raw }}
                                <div class="time meta">{{ meta.notification.createdAt|time_diff }}</div>
                            </div>
                            {% if meta.notification.message %}
                            <div class="body markdown-body">{{ meta.notification.message|raw }}</div>
                            {% endif %}
                        </div>
                    </div>
                </li>
            {% else %}
                <li class="list-group-item empty-data">
                    <i class="if i-bell"></i> {{ 'notification.empty'|trans }}
                </li>
            {% endfor %}
        </ul>
        {% if notificationMeta.haveToPaginate %}
            <footer class="panel-footer">
                {% from 'PHPDishWebBundle:Macros:paginator.html.twig' import paginator %}
                {{ paginator(notificationMeta) }}
            </footer>
        {% endif %}
    </div>
{% endblock %}